﻿using Newtonsoft.Json.Linq;
using System;

namespace XbmcManager.Types
{
    public class XbmcSeason
    {
        #region Properties
        private static string SEASON = "season";
        private static string EPISODE = "episode";
        private static string SHOWTITLE = "showtitle";
        private static string PLAYCOUNT = "playcount";
        private static string TVSHOWID = "tvshowid";
        private static string WATCHEDEPISODES = "watchedepisodes";

        public int Season;
        public String ShowTitle;
        public int PlayCount;
        public int EpisodeCount;
        public int TvShowID;
        public int WatchedEpisodes;
        public readonly static string[] FIELDS = {SEASON
                                                     ,SHOWTITLE
                                                     ,PLAYCOUNT
                                                     ,EPISODE
                                                     ,TVSHOWID
                                                     ,WATCHEDEPISODES};
        #endregion

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="season"></param>
        public XbmcSeason(JObject season)
        {
            this.Season = (int)season[SEASON];
            this.ShowTitle = (String)season[SHOWTITLE];
            this.PlayCount = (int)season[PLAYCOUNT];
            this.EpisodeCount = (int)season[EPISODE];
            this.TvShowID = (int)season[TVSHOWID];
            this.WatchedEpisodes = (int)season[WATCHEDEPISODES];
        }
    }
}
